/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.thienloc.omap.entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author GiangLT
 */
@Entity
@Table(name = "TBL_RAW_MT", catalog = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "TblRawMt.findAll", query = "SELECT t FROM TblRawMt t"),
    @NamedQuery(name = "TblRawMt.findAllShortCode", query = "SELECT DISTINCT(t.sc) FROM TblRawMt t"),
    @NamedQuery(name = "TblRawMt.findById", query = "SELECT t FROM TblRawMt t WHERE t.id = :id"),
    @NamedQuery(name = "TblRawMt.findBySc", query = "SELECT t FROM TblRawMt t WHERE t.sc = :sc"),
    @NamedQuery(name = "TblRawMt.findByTime", query = "SELECT t FROM TblRawMt t WHERE t.time = :time"),
    @NamedQuery(name = "TblRawMt.findByContent", query = "SELECT t FROM TblRawMt t WHERE t.content = :content"),
    @NamedQuery(name = "TblRawMt.findByTelco", query = "SELECT t FROM TblRawMt t WHERE t.telco = :telco"),
    @NamedQuery(name = "TblRawMt.findByM", query = "SELECT t FROM TblRawMt t WHERE t.m = :m"),
    @NamedQuery(name = "TblRawMt.findByServiceCode", query = "SELECT t FROM TblRawMt t WHERE t.serviceCode = :serviceCode"),
    @NamedQuery(name = "TblRawMt.findByGen1", query = "SELECT t FROM TblRawMt t WHERE t.gen1 = :gen1"),//noi dung rut gon
    @NamedQuery(name = "TblRawMt.findByGen2", query = "SELECT t FROM TblRawMt t WHERE t.gen2 = :gen2"),//ma tinh
    @NamedQuery(name = "TblRawMt.findByGen3", query = "SELECT t FROM TblRawMt t WHERE t.gen3 = :gen3"),//cac cu phap mo tuong ung
    @NamedQuery(name = "TblRawMt.findByResult", query = "SELECT t FROM TblRawMt t WHERE t.result = :result")})
public class TblRawMt implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "ID")
    private Long id;
    @Size(max = 22)
    @Column(name = "SC")
    private String sc;
    @Column(name = "TIME")
    @Temporal(TemporalType.TIMESTAMP)
    private Date time;
    @Size(max = 4000)
    @Column(name = "CONTENT")
    private String content;
    @Basic(optional = false)
    @Size(min = 1, max = 10)
    @Column(name = "TELCO")
    private String telco;
    @Size(max = 2)
    @Column(name = "M")
    private String m;
    @Size(max = 160)
    @Column(name = "SERVICE_CODE")
    private String serviceCode;
    @Size(max = 100)
    @Column(name = "GEN1")
    private String gen1;
    @Size(max = 150)
    @Column(name = "GEN2")
    private String gen2;
    @Size(max = 200)
    @Column(name = "GEN3")
    private String gen3;
    @Column(name = "RESULT")
    private Short result;
    @Transient
    private Long count;

    public TblRawMt() {
    }

    public TblRawMt(Long id) {
        this.id = id;
    }

    public TblRawMt(Long id, String telco) {
        this.id = id;
        this.telco = telco;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getSc() {
        return sc;
    }

    public void setSc(String sc) {
        this.sc = sc;
    }

    public Date getTime() {
        return time;
    }

    public void setTime(Date time) {
        this.time = time;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getTelco() {
        return telco;
    }

    public void setTelco(String telco) {
        this.telco = telco;
    }

    public String getM() {
        return m;
    }

    public void setM(String m) {
        this.m = m;
    }

    public String getServiceCode() {
        return serviceCode;
    }

    public void setServiceCode(String serviceCode) {
        this.serviceCode = serviceCode;
    }

    public String getGen1() {
        return gen1;
    }

    public void setGen1(String gen1) {
        this.gen1 = gen1;
    }

    public String getGen2() {
        return gen2;
    }

    public void setGen2(String gen2) {
        this.gen2 = gen2;
    }

    public String getGen3() {
        return gen3;
    }

    public void setGen3(String gen3) {
        this.gen3 = gen3;
    }

    public Short getResult() {
        return result;
    }

    public void setResult(Short result) {
        this.result = result;
    }

    public Long getCount() {
        return count;
    }

    public void setCount(Long count) {
        this.count = count;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TblRawMt)) {
            return false;
        }
        TblRawMt other = (TblRawMt) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.thienloc.omap.entity.TblRawMt[ id=" + id + " ]";
    }
}
